
<!DOCTYPE html PUBLIC "-//W3C//XHD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/XHD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>会员注册_中国旅游网</title>
    <meta name="keywords" content="旅游，旅游网，自助游，跟团游，公司旅游"/>
    <meta name="description" content="旅游，旅游网，自助游，跟团游，公司旅游"/>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="/css/login.css"/>
</head><script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript">

    function doReg(){

        var phone=$("#phone").val();
        var password=$("#password").val();
        var password2=$("#password2").val();
        if (phone==""){
            $("#phone").focus();
            $("#phone_msg").html("请输入手机号！")
            return
        }else{
            $("#phone_msg").html("")
        }
        if (password==""){
            $("#password").focus();
            $("#password_msg").html("请输入密码！")
            return
        }else{
            $("#password_msg").html("")
        }
        if (password2==""){
            $("#password2").focus();
            $("#password2_msg").html("请输入确认密码！")
            return
        }else{
            $("#password2_msg").html("")
        }
        if(password!=password2){
            $("#msg").html("登录密码和确认密码不同，请重新输入！")
            return;
        }

        $.ajax({
            url:'doReg',
            type:'post',
            dataType:'json',//服务器端返回的数据格式是json
            data: {
                "phone":phone,
                "password":password,
                "password2":password2
            },//发给服务器端的数据
            success:function(data){   //data:服务器端返回给浏览器端的数据
                console.log(data)
                if(data.code==0){
                    alert(data.msg)
                    location.href='login.html';
                }else{
                    //alert("用户名或密码错误，请重新登录！");
                    $("#msg").html(data.msg)
                }
            },
            error:function (XMLHttpRequest, textStatus, errorThrown) {
                alert(XMLHttpRequest);
                alert(textStatus);
                alert(errorThrown);
            }

        });
    }

</script>
<body>
<div id="header">
    <div class="wrapper clearfix">
        <div class="logo">

        </div>
        <div class="links">
            <ul class="clearfix">
                <li><a href="login.html">会员登录</a></li>
                <li><a href="reg2.html">免费注册</a></li>
                <li><a href="/">网站首页</a></li>
            </ul>
        </div>
    </div>
</div>
<div id="main">
    <div class="wrapper clearfix">
        <div class="wrapBox">
            <div class="inner">
                <div class="hd"><b>
                    会员注册
                </b></div>
                <div class="do clearfix">
                    <div class="signLeft">
                        <form method="post" id="TourExForm" name="TourExForm">
                            <ul class="signs clearfix">
                                <li><label for="U_Mobile">手机号码：</label><input type="input" id="phone" name="U_Mobile" class="inputText"><div id="phone_msg" style="color: red"></div></li>
                                <li><label for="U_Pass">登录密码：</label><input type="password" id="password" name="U_Pass" class="inputText"><div id="password_msg" style="color: red"></div></li>
                                <li><label for="okPass">确认密码：</label><input type="password" id="password2" name="okPass" class="inputText"><div id="password2_msg" style="color: red"></div></li>
                                <li class="btn"><label for="">&nbsp;</label><input name="submit1" type="button" onclick="doReg()" class="inputBtn reg" value=" " /></li>
                                <li><div id="msg" style="color: red"></div></li>
                            </ul>
                        </form>
                    </div>
                    <div class="signRight">
                        <h2 class="title">已有账号，立即登录</h2>
                        <ul class="applogin clearfix">
                            <li><a href="http://www.cntour.cn/usercenter/login.aspx" class="login" title="会员登录">&nbsp;</a></li>
                        </ul>
                        <h2 class="title">使用合作网站帐号登录</h2>
                        <ul class="applogin clearfix">
                            <li><a href="http://www.cntour.cn/loginsina/" class="sina" title="新浪微博">&nbsp;</a></li><li><a href="http://www.cntour.cn/loginali/" class="alipay" title="支付宝">&nbsp;</a></li><li><a href="http://www.cntour.cn/loginqq/" class="qq" title="腾讯QQ">&nbsp;</a></li>							</ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--页脚脚本开始-->
<div id="footerJs">

</div>
<!--页脚脚本结束-->
</body>
</html>